package pe.gob.mpfn.service;

import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import pe.gob.mpfn.model.Personal;


@Service
@Transactional
public class PersonalServiceImpl implements PersonalService {

	public long countAllPersonals() {
        return Personal.countPersonals();
    }

	public void deletePersonal(Personal personal) {
        personal.remove();
    }

	public Personal findPersonal(Integer id) {
        return Personal.findPersonal(id);
    }

	public List<Personal> findAllPersonals() {
        return Personal.findAllPersonals();
    }

	public List<Personal> findPersonalEntries(int firstResult, int maxResults) {
        return Personal.findPersonalEntries(firstResult, maxResults);
    }

	public void savePersonal(Personal personal) {
        personal.persist();
    }

	public Personal updatePersonal(Personal personal) {
        return personal.merge();
    }
}
